package customer.zspt.cn.customer.Widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import customer.zspt.cn.customer.R;

/**
 * Created by Administrator on 2018/6/7 0007.
 */

public class ContactItemView extends LinearLayout {
    public  ImageView icon;
    public  TextView text;
    public ContactItemView(Context context) {
        this(context,null);
    }
    public ContactItemView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,0);
    }
    public ContactItemView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        View.inflate(context, R.layout.contact_topitem,this);
        icon = (ImageView)findViewById(R.id.icon);
        text = (TextView)findViewById(R.id.text);
    }
    /**
     * 设置文字
     */
     public void setText(String Name)
     {
         text.setText(Name);
     }
    /**
     * 设置图标
     */
    public void setIcon(int ResoureImg)
    {
        icon.setImageResource(ResoureImg);
    }
    /**
     * 设置网络的图片
     */
    public ImageView getTitleView()
    {
        return icon;
    }
}
